Use ATE
go



--RepairConfig_Changelog



--/*
IF OBJECT_ID ( 'RepairConfig_Changelog', 'U' ) IS NOT NULL 
    DROP table RepairConfig_Changelog;
GO
CREATE table RepairConfig_Changelog
(
ID int identity(1,1),
RecordTime datetime,
UserID nvarchar(10),
IPAddress nvarchar(20),
RepairPath nvarchar(50) not null,
OldStatus nvarchar(500),
NewStatus nvarchar(500)
)

--*/



IF OBJECT_ID ( 'RepairConfig_Changelog_Insert', 'P' ) IS NOT NULL 
    DROP PROCEDURE RepairConfig_Changelog_Insert;
GO
CREATE PROCEDURE RepairConfig_Changelog_Insert
	@ID int,
	@RecordTime datetime,
	@UserID nvarchar(10),
	@IPAddress nvarchar(20),
    @RepairPath nvarchar(50),
    @OldStatus nvarchar(500),
    @NewStatus nvarchar(500)	
AS    
    SET NOCOUNT ON;
    insert into RepairConfig_Changelog(RecordTime,UserID,IPAddress,RepairPath,OldStatus,NewStatus)
	values(getdate(),@UserID,@IPAddress,@RepairPath,@OldStatus,@NewStatus)
GO 




IF OBJECT_ID ( 'RepairConfig_Changelog_selectbyDT', 'P' ) IS NOT NULL 
    DROP PROCEDURE RepairConfig_Changelog_selectbyDT;
GO
CREATE PROCEDURE RepairConfig_Changelog_selectbyDT
    @starttime datetime,
    @stoptime datetime	
AS    
    SET NOCOUNT ON;
    select ID,RecordTime,UserID,IPAddress,RepairPath,OldStatus,NewStatus
    from RepairConfig_Changelog
	where RecordTime between @starttime and @stoptime 
GO 